package lumis.portal.sendmail;

import java.util.Date;

import lumis.portal.stability.StableMinor;

/**
 * Superinterface with common methods of mails interfaces.
 * @see ISingleMail
 * @see IMultipleMail
 * @see ISendMailManager
 * @since 4.0.4
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
public interface IBaseMail extends IMailSendStatus
{
	/**
	 * Indicates the mail is a single mail.
	 */
	public static final int MAIL_TYPE_SINGLE = 1;
	
	/**
	 * Indicates the mail is a multiple mail, i.e. will span several other mails when sending.
	 */
	public static final int MAIL_TYPE_MULTIPLE = 2;
	
	/** 
	 * Returns the date this mail has been requested to be sent.
	 * May be null, if the send request was not made yet.
	 * @return the date this mail has been requested to be sent.  
	 * @since 4.0.4
	 */
	public Date getRequestDateTime();

	/** 
	 * Returns the body of this mail.
	 * @return the body of this mail.
	 * @since 4.0.4
	 */
	public IMailBody getBody();

	/** 
	 * Returns the charset of this mail.
	 * @return the charset of this mail. 
	 * @since 4.0.4
	 */
	public String getCharset();

	/**
	 * Sets the chartset of this mail. 
	 * @param charset the charset.
	 * @since 4.0.4
	 */
	public void setCharset(String charset);

	/**
	 * Returns the from field of this mail. 
	 * @return the from field of this mail.
	 * @since 4.0.4
	 */
	public String getFrom();

	/**
	 * Sets the from field of this mail.
	 * @param from the from field value.
	 * @since 4.0.4
	 */
	public void setFrom(String from);

	/**
	 * Returns the id of this mail. This id is a unique identifier for this mail.
	 * @return the id of this mail.
	 * @since 4.0.4
	 */
	public String getId();

	/**
	 * Returns the reply to field of this mail. May contain a list of email addresses
	 * separated by comma.
	 * @return the reply to field of this mail. 
	 * @since 4.0.4
	 */
	public String getReplyTo();

	/**
	 * Sets the reply to field of this mail. May contain a list of email addresses
	 * separated by comma.
	 * @param replyTo the reply to field value.
	 * @since 4.0.4
	 */
	public void setReplyTo(String replyTo);

	/**
	 * Returns the subject of this mail.
	 * @return the subject of this mail.
	 * @since 4.0.4
	 */
	public String getSubject();

	/**
	 * Sets the subject of this mail.
	 * @param subject the subject value.
	 * @since 4.0.4
	 */
	public void setSubject(String subject);
	
	/**
	 * Returns the string describing the source component for this mail request.
	 * @return the string describing the source component for this mail request.
	 * @see #getSourceComponentStringsUrl()
	 * @since 4.0.4
	 */
	public String getSourceComponent();
	
	/**
	 * Sets the string describing the source component for this mail request.
	 * @param sourceComponent the string value.
	 * @see #setSourceComponentStringsUrl(String)
	 * @since 4.0.4
	 */
	public void setSourceComponent(String sourceComponent);
	
	/**
	 * Returns the strings url prefix for translating {@link #getSourceComponent()}.
	 * @return the strings url prefix for translating {@link #getSourceComponent()}.
	 * @since 4.0.4
	 */
	public String getSourceComponentStringsUrl();
	
	/**
	 * Sets the strings url prefix for translating {@link #getSourceComponent()}.
	 * @param sourceComponentStrings the value to set.
	 * @see #setSourceComponent(String)
	 * @since 4.0.4
	 */
	public void setSourceComponentStringsUrl(String sourceComponentStrings);
	
	/**
	 * Returns the type of this mail.
	 * @return the type of this mail.
	 * @see #MAIL_TYPE_SINGLE
	 * @see #MAIL_TYPE_MULTIPLE
	 * @since 4.0.4
	 */
	public int getMailType();
	
	/**
	 * Returns a String used for logging this mail.
	 * @return the string for logging this mail.
	 * @since 4.0.4
	 */
	public String getMailLoggingString();
}